/**
 * @Date 2020-06-24 16:22:15
 * @Remark
 */

import { Api } from "@/public/model/api";
import { ReqById, ReqPage, ResBoolean, ResObject, ResPage } from "@/public/model/base";
import { CompanyDto } from "./model";

/**
 * api
 */
export const API_COMPANY_PAGE: Api = {
  title: "菜单分页",
  path: "company/list",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单company操作接口",
};

// req
export interface ReqCompanyPage extends ReqPage {
}

// res
export type ResCompanyPage = ResPage<CompanyDto>

/**
 * api
 */
export const API_COMPANY_ADD: Api = {
  title: "添加菜单",
  path: "company/add",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单company操作接口",
};

// req
export interface ReqCompanyAdd {
  companyName: string;
}

// res
export type ResCompanyAdd = ResObject<CompanyDto>

/**
 * api
 */
export const API_COMPANY_UPDATE: Api = {
  title: "编辑菜单",
  path: "company/update",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单company操作接口",
};

// req
export interface ReqCompanyUpdate extends ReqById, ReqCompanyAdd {}

// res
export type ResCompanyUpdate = ResObject<CompanyDto>

/**
 * api
 */
export const API_COMPANY_DEL: Api = {
  title: "删除菜单",
  path: "company/delete",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单company操作接口",
};

// req
export type ReqCompanyDel = ReqById

// res
export type ResCompanyDel = ResBoolean
